package com.example.handler;

import com.example.constants.ErrorCodeEnum;

public class BusinessErrorException extends Exception {

    /**
     * 
     */
    private static final long serialVersionUID = -7480022450501760611L;

    /**
     * 异常码
     */
    private String code;

    /**
     * 异常提示信息
     */
    private String message;

    public BusinessErrorException() {
        super();
    }

    public BusinessErrorException(ErrorCodeEnum code) {
        super();
        this.code = code.code();
        this.message = code.msg();
    }

    public BusinessErrorException(ErrorCodeEnum code, String message) {
        super();
        this.code = code.code();
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
